<?php
	class Questionnaire{
		private $id; // l'id de la question courante
		private $idRefQuestion; // l'id de la question
		private $idRefEleve; // l'id de l'eleve
		private $contenu; // le contenu

	
		public function __construct(){
			if(func_num_args() == 1)
			$this->hydrate(func_get_arg(0));
		}
		
		public function hydrate(array $donnees){
			foreach ($donnees as $key => $value){
				$method = 'set'.ucfirst($key);
				if (method_exists($this, $method)){
					$this->$method($value);
				}
			}
		}
		
		// GETTERS
		public function id(){return $this->id;}
		public function contenu(){return $this->contenu;}
		public function idRefEleve(){return $this->idRefEleve;}
		public function idRefQuestion(){return $this->idRefQuestion;}
		
		// SETTERS
		public function setId($newId){$this->id = $newId;}
		public function setIdRefEleve($newIdRefEleve){$this->idRefEleve = $newIdRefEleve;}
		public function setContenu($newContenu){$this->contenu = $newContenu;}
		public function setIdRefQuestion($newIdRefQuestion){$this->idRefQuestion = $newIdRefQuestion;}
	}
?>